package com.example.shoppingmall.service;

import com.example.shoppingmall.pojo.PropertyJurisdiction;
import com.example.shoppingmall.dao.PropertyJurisdictionMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PropertyJurisdictionService {
    @Autowired
    private PropertyJurisdictionMapper propertyJurisdictionMapper;

    public List<PropertyJurisdiction> propertyJurisdictionListByPropertyId(@Param("propertyId")int propertyId){
        return propertyJurisdictionMapper.propertyJurisdictionListByPropertyId(propertyId);
    }

    public int delete(@Param("id")int id){
        return propertyJurisdictionMapper.delete(id);
    }

    public int add(PropertyJurisdiction propertyJurisdiction){
        return propertyJurisdictionMapper.add(propertyJurisdiction);
    }

    public int chackName(@Param("name")String name,@Param("propertyId")int propertyId){
        return propertyJurisdictionMapper.chackName(name,propertyId);
    }

}
